package com.rongshe.hotel.service.impl;

import java.util.List;
import com.rongshe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rongshe.hotel.mapper.RsGoodCategoryMapper;
import com.rongshe.hotel.domain.RsGoodCategory;
import com.rongshe.hotel.service.IRsGoodCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author rongshe
 * @date 2025-02-17
 */
@Service
public class RsGoodCategoryServiceImpl implements IRsGoodCategoryService 
{
    @Autowired
    private RsGoodCategoryMapper rsGoodCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public RsGoodCategory selectRsGoodCategoryById(Long id)
    {
        return rsGoodCategoryMapper.selectRsGoodCategoryById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param rsGoodCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<RsGoodCategory> selectRsGoodCategoryList(RsGoodCategory rsGoodCategory)
    {
        return rsGoodCategoryMapper.selectRsGoodCategoryList(rsGoodCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param rsGoodCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertRsGoodCategory(RsGoodCategory rsGoodCategory)
    {
        rsGoodCategory.setCreateTime(DateUtils.getNowDate());
        return rsGoodCategoryMapper.insertRsGoodCategory(rsGoodCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param rsGoodCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateRsGoodCategory(RsGoodCategory rsGoodCategory)
    {
        rsGoodCategory.setUpdateTime(DateUtils.getNowDate());
        return rsGoodCategoryMapper.updateRsGoodCategory(rsGoodCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteRsGoodCategoryByIds(Long[] ids)
    {
        return rsGoodCategoryMapper.deleteRsGoodCategoryByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteRsGoodCategoryById(Long id)
    {
        return rsGoodCategoryMapper.deleteRsGoodCategoryById(id);
    }
}
